<head>
<body>	
		<h1>A java shorkeys manager</h1>
		<p>that combines  in a xml file text strings or sets of commands (tab, enter...) with a key on the keyboard</p>
		<h2>Start the application with </h2>
		<pre>java -jar kbhook.jar [kbhook.properties]</pre>
        <p>If not specified, the name of the properties file default to  kbhook.properties. You may also double-click the jar file (but there won't be any message shown). </p>
        <h2>Syntax of the xml shortkey.file</h2>
        <pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
           &lt;!DOCTYPE shortkey SYSTEM &quot;dtd/shk.dtd&quot;&gt;
           &lt;shortkey&gt;
           &lt;data k='q'&gt;
           dokpe_rebut_#t01#d10#t02DOKPE FAC#t06IANAT#t12#r01#t01Mis au rebut en 2007#t01$9 r/2007/0068#t08#r01#t01#e01#d01non disp#t01DOKPE FAC#t01#e01
           &lt;/data&gt;
           &lt;data k='t'&gt;
           dokpe_rebut_#t01#d10#t02DOKPE FAC#t06IANAT#t13#r01#t01Mis au rebut en 2007#t01$9 r/2007/0068#t08#r01#t01#e01#d01non disp#t01DOKPE FAC#t01#e01
           &lt;/data&gt;
           &lt;data k='o'&gt;
           #r01#t01Mis au rebut en 2007#t01$9 r/2007/0138#t08#r01#t01#e01#d01non disp#t01DOKPE FAC#t01#e01
           &lt;/data&gt;
           &lt;data k='s'&gt;
           $9 r/2007/0138 &amp;amp; crac
           &lt;/data&gt;
			&lt;data k='j' use.ctrl_v='1'&gt;Journal of Negative Results&lt;/data&gt;
			&lt;data k='y'&gt;2007&lt;/data&gt;
			&lt;data k='v'&gt;10&lt;/data&gt;
			&lt;data k='n'&gt;2&lt;/data&gt;
			&lt;data k='p'&gt;25-32&lt;/data&gt;
           &lt;data k='z'&gt;&lt;dataref id='j' /&gt;#t01&lt;dataref id='y' /&gt;#t01&lt;dataref id='v' /&gt;#t01&lt;dataref id='n' /&gt;#t01&lt;dataref id='p' /&gt;&lt;/data&gt;
&lt;/shortkey&gt;</pre>
        <p>Shortkeys are called with the &quot;&lt;&quot; key follows with the character(s) key(s) given in the k attribut. The string enclosed in data is written where the cursor is. This is done with the clipboard if the attribut use.ctrl_v='1' is given for a data element, or with the sendInput Windows function. The string can be encoded with unicode characters. Please take note that  &amp; &lt; &gt; have to be replaced by the corresponding html entities &amp;amp; &amp;lt; &amp;gt;. </p>
        <p>A data element can contains  dataref elements when the id attribut is the same as a k attribut of another data element already defined in the file. In the example above the key  z will call the content defined for data elements having k=j, y, v chained with a tab keystroke.</p>
        <p>The file  whose name is given by the property virtualKey.file (see below) combines commands virtual key codes and characters. For example the line &quot;t=VK_TAB&quot; associate t with the tab key </p>
        <h2>Syntax for the commands keytroke in the shortkey file </h2>
        <ul>
          <li>a command keystroke start with  # (to diplay # as a character, it has to be enter has ##), next we have to give </li>
          <li> the command, set by a character listed in the file defined with the property virtualKey.file (one position) </li>
          <li>how much we want to repeat that command,  on two position, with a padding 0 if necessary (01)  23</li>
          <li>The following  characters are treated as text (unless a new command keystroke is defined). </li>
          <li>The shift, control and alt keys are released 
            <ul>
              <li>after a non-command key has been given. For example ctr+shift+a (written as #c01#s01a) will send the following event: key press for the keys control and shift, key press and released for the a key, key release for shift and control</li>
              <li>at the end of a command keystroke, if the keys have not been released. For example a sequence of shit+tab, shift+tab, shift+tab (#s01#t01#t01#t01) will release the shift key at the end. On the contrary #s01#t01#t01#t01abc will call three back tab and will write Abc. </li>
            </ul>
          </li>
        </ul>
        
        <h2>Other files </h2>
        <dl>
		  <dt>kbhook.properties</dt>
		  <dd><ul>
		  <li>shorkey.file.name=shortkeys.xml <em>Name of the shorktkeys file</em></li>
		    <li>shorkey.file.encoding=UTF-16 <em>The encoding of this file </em></li>
		    <li>use.ctrl_v=false <em>Do not use the clipboard to send the data (with ctrl+v) but use the sendString function (default to false). It is possible to use the clipboard for some elements only with setting the attribute use.ctrl_v='1' in the shortkeys file. If you define this property on true in the property file will prevent you from using commands strokes </em></li>
		    <li>virtualKey.file=vkcode.properties <em>Name of a property file that contains the commands: If this property is missing, the data from the shortkey file will be send as string</em></li>
		    <li> ms.delay=50 <em>Delay in milliseconds between two commands </em> </li>
		    <li>load.key=VK_HOME <em>The key that will call a new parsing of the shortkeys file</em></li>
	      <li>quit.key=VK_ESCAPE <em>The key the will quit the application</em></li>
		  <li>native.access=jna <em>Use the JNA library to access the keyboardl. The dll file are not use (native.access=jni to use it)</em></li>
		  <li>DEBUG <em>if present, gives a lot of messages. </em></li>
		  </ul>
</dd>
<dt>vkcode.properties </dt>

<DD><em>Use the syntax character=virtual key code symbol. The file bind the characters you use for a command in a commands keystroke with the virtual key code. The syntax for the key code is form the  java.awt.event.KeyEvent class. The corresponding codes are sent directly to the keyboard since they are identical for Windows and Java.</em></DD>
<DD>
  <ul>
      <li>t=VK_TAB</li>
      <li> e=VK_ENTER </li>
      <li># e=VK_RETURN </li>
      <li>d=VK_DOWN </li>
      <li>l=VK_LEFT </li>
      <li>r=VK_RIGHT </li>
      <li>x=VK_BACK_SPACE
                  # </li>
      <li>x=VK_BACK</li>
      <li>s=VK_SHIFT</li>
      <li>c=VK_CONTROL</li>
      <li>a=VK_ALT</li>
    </ul>
</DD>

	<dt>dtd/shk.dtd</dt>
	<DD><em>The dtd file that described the structure of the xml shorkey file</em></DD>
	<dt>dtd/xhtml_lat1.ent</dt>
	<DD><em>The entities for the same  xml file </em></DD>
	<dt>kbhook.dll</dt>
	<DD><em>The dll resulting from the compilation of the cpp file (there are 32 or 64 bytes version, that has to be renamed (kbhook32.dll in kbhook.dll) to be used by the java code. This is not used if the property native.access is set to jna </em></DD>
</dl>
</Body>
</head>
